[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
op= Compound Assignment Operator
lval op= exp compound assignment
lval any variable that can be assigned to
op any binary operator except && or ||
exp any compatible expression
The op= operator is a shortcut for the expression
lval = lval op exp;
In other words, it performs the indicated operation, then assigns the
result to lval. If lval is a pointer and op is + or -, then exp must
be of an integral type.
-------------------------------- Examples ---------------------------------
i *= j; --> i = i * j;
i /= j; --> i = i / j;
i %= j; --> i = i % j;
i += j; --> i = i + j;
i -= j; --> i = i - j;
i <<= j; --> i = i << j;
i >>= j; --> i = i >> j;
i &= j; --> i = i & j;
i ^= j; --> i = i ^ j;
i |= j; --> i = i | j;
See Also:
conversions
=
*
/
%
+
-
<<
>>
&
|
^^
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson